package alarmmodel

import (
	"github.com/aide-family/moon/pkg/palace/model"
	"github.com/aide-family/moon/pkg/vobj"
)

const tableNameAlarmSendHistory = "alarm_send_history"

// AlarmSendHistory 发送历史
type AlarmSendHistory struct {
	model.EasyModel
	// 告警组ID
	AlarmGroupID uint32 `gorm:"column:alarm_group_id;type:int;not null;comment:接收对象" json:"alarmGroupId"`
	// 发送数据
	SendData string `gorm:"column:send_data;type:text;not null;comment:发送数据" json:"sendData"`
	// 请求id
	RequestID string `gorm:"column:request_id;type:varchar(255);not null;comment:请求id" json:"requestId"`
	Route     string `gorm:"column:route;type:varchar(50);not null;comment:路由" json:"route"`
	// 重试次数
	RetryNumber int `gorm:"column:retry_number;type:int;not null;comment:重试次数" json:"retryNumber"`
	// 发送状态
	SendStatus vobj.SendStatus `gorm:"column:send_status;type:tinyint;not null;comment:发送状态" json:"sendStatus"`
	// 发送时间
	SendTime string `gorm:"column:send_time;type:varchar(100);not null;comment:发送时间" json:"sendTime"`
}

// TableName overrides the default table name generated by gorm
func (*AlarmSendHistory) TableName() string {
	return tableNameAlarmSendHistory
}
